<template>
	
</template>

<script>
	export default{
		mounted:function(){
			this.initInfo();
		},methods:{
			initInfo:function(){
				var _self = this;
				var userticket =  _self.$route.query.userticket;
				//先根据userticket 获取 User
				var url = _self.utilHelper.apiUrl+"/wordFlowData/getUser";
				var params = {
					userticket:userticket
				};
				_self.$http.post(url,params).then((response)=>{
					var body = response.body;
					if(body.res== 0){
						layer.alert(body.resMsg);
					}else{
						var userOaCode = body.resMsg;
						document.setTitle("绿城报表");
						//询问框
						layer.confirm('请选择查看报表!', {
						btn: ['客户报表','销售报表'] //按钮
						}, function(){
							layer.closeAll('dialog');
							if(!userOaCode){
								console.log("userticket:" + userticket + ", userOaCode: " + userOaCode);
								layer.alert("请求错误: 用户为空,数据获取失败!");
								return;
							}
							_self.$router.push({path:'/report/customerLevel/'+userticket+'/'+userOaCode});
						}, function(){
							layer.closeAll('dialog');
							if(!userOaCode){
								console.log("userticket:" + userticket + ", userOaCode: " + userOaCode);
								layer.alert("请求错误: 用户为空,数据获取失败!");
								return;
							}
							_self.$router.push({path:'/report/salesReport/'+userticket+'/'+userOaCode});
						});

					}
				});
				
			
			}
		}
	}
</script>

